package com.jichangxiu.common.enums;

public enum ErrorType {

    // 服务端错误
    SERVER_EXCEPTION(2, "服务异常，请联系开发人员"),

    // 框架错误
    FRAME_EXCEPTION(3, "框架异常，请联系开发人员"),

    // 业务错误
    SERVICE_EXCEPTION(4, "业务异常，请联系开发人员"),

    // 逻辑流程错误
    FLOW_EXCEPTION(5, "逻辑流程异常，请联系开发人员"),

    UNAUTHORIZED_EXCEPTION(4001, "当前用户已被登出或无权限访问当前资源，请尝试重新登录后再操作"),

    CREDENTIAL_EXCEPTION(4003, "登录信息有误"),

    CAPTCHA_EXCEPTION(4004, "验证码错误"),

    ;

    private Integer code;

    private String message;

    ErrorType(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

}
